package backend.majiong;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;



public class MahjUtils {

    public void sortHai(List<Pai> list) {
        Collections.sort(list, new Comparator<Pai>() {

            @Override
            public int compare(Pai o1, Pai o2) {
                int rs = o1.getType().compareTo(o2.getType());
                if (rs != 0)
                    return rs;
                return o1.getNum().compareTo(o2.getNum());
            }

        });
    }

}
